enum signal {
    red("红色"),yellow("黄色"),green("绿色");
    String name;

    signal(String name) {
        this.name = name;
    }
}
class text {
    public static void main(String[] args) {
        signal light = signal.green;
        switch (light) {
            case red:
                System.out.println("停下");
                break;
            case green:
                System.out.println("前进");
                break;
            case yellow:
                System.out.println("减速慢行");
                break;
            default:
                System.out.println("错误");
        }
    }

}
